import mongoose, { Schema } from 'mongoose';

const schema = new Schema(
  {
    channel: { type: Schema.Types.ObjectId, ref: 'Channel', index: true },
    user: { type: Schema.Types.ObjectId, ref: 'User', index: true },
    group: { type: Schema.Types.ObjectId, ref: 'Group' },
    createdAt: { type: Date, default: Date.now, index: true },
    service: { type: Schema.Types.Mixed, default: Date.now, index: true },
  },
  {
    collection: 'waitList',
  },
);

export default mongoose.model('WaitList', schema);
